/**
 * Created by XX.Chan on 2017/2/13.
 */
//电影详细页
(function (angular) {
    var app = angular.module('mainApp.subject',['httpApp']);

    app.controller('subjectCtrl', ['$scope','$routeParams','jsonpService',function ($scope,$routeParams,jsonpService) {

        //根据传递过来的id拼接url
        var url = 'https://api.douban.com/v2/movie/subject/'+$routeParams.id;

        var params = {
            apikey:'00fa6c0654689a0202ef4412fd39ce06'
        }

        $scope.subject={}

        jsonpService.getJSONP(url,params, function (data) {
           $scope.subject = data;
            $scope.$apply()
        })
    }])

})(angular)